﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SearchMain.aspx.cs" Inherits="Workflow.Project.Search" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="../Css/style.css" />
    <script type="text/javascript" src="../Js/jquery.js"></script>
    <script type="text/javascript" src="../Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="../Js/bootstrap.js"></script>
    <script type="text/javascript" src="../Js/ckform.js"></script>
    <script type="text/javascript" src="../Js/common.js"></script>

    <script type="text/javascript" src="../Scripts/MyJquery.js"></script>
    <script type="text/javascript" src="../Scripts/jquery.js"></script>
    <script type="text/javascript" src="../Scripts/jquery.pagination.js"></script>
    <script type="text/javascript" src="../Scripts/Pageination.js"></script>
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


        .auto-style1 {
            width: 230px;
        }


    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table class="table table-bordered table-hover definewidth m10">
            
            <tr>
                <td class="tableleft">项目编号范围</td>
                <td class="auto-style1">
                    <asp:TextBox ID="txtNo1" runat="server"></asp:TextBox></td>
                <td>
                    <asp:TextBox ID="txtNo2" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td class="tableleft">项目名称</td>
                <td class="auto-style1">
                    <asp:TextBox ID="txtPJName" runat="server"></asp:TextBox></td>
                <td>
                </td>
            </tr>
            <tr>
                <td class="tableleft">项目创建人</td>
                <td class="auto-style1">
                    <asp:TextBox ID="txtPJCreater" runat="server"></asp:TextBox></td>
                <td>
                </td>
            </tr>
            <tr>
                <td class="tableleft">项目类型</td>
                <td>
                    <asp:DropDownList ID="ddlPJType" runat="server">
                        <asp:ListItem>全部</asp:ListItem>
                        <asp:ListItem>战略项目</asp:ListItem>
                        <asp:ListItem>平台项目</asp:ListItem>
                        <asp:ListItem>一般项目</asp:ListItem>
                    </asp:DropDownList></td>
                <td></td>
            </tr>
            <tr>
                <td class="tableleft">项目模类型</td>
                <td>
                    <asp:DropDownList ID="ddlMoldType" runat="server">
                        <asp:ListItem>全部</asp:ListItem>
                        <asp:ListItem>量产模</asp:ListItem>
                        <asp:ListItem>样品模</asp:ListItem>
                        <asp:ListItem>商品模</asp:ListItem>
                        <asp:ListItem>转移模</asp:ListItem>
                        <asp:ListItem>备模</asp:ListItem>
                    </asp:DropDownList></td>
                <td></td>
            </tr>
            <tr>
                <td class="tableleft"></td>
                <td class="auto-style1">
                    <asp:Button ID="BtnSubmit" CssClass="btn btn-primary" runat="server" Text="查询" OnClientClick="return Validate()" OnClick="BtnSubmit_Click"/>
                </td>
                <td></td>
            </tr>
         </table>
        <table class="table table-bordered definewidth m10">
            <thead>
                <tr>
                    <th>项目号</th>
                    <th>项目创建人</th>
                    <th>T1预估完成时间</th>
                    <th>T2预估完成时间</th>
                    <th>T3预估完成时间</th>
                    <th>T4预估完成时间</th>
                    <th>T5预估完成时间</th>
                    <th>T1完成时间</th>
                    <th>T2完成时间</th>
                    <th>T3完成时间</th>
                    <th>T4完成时间</th>
                    <th>T5完成时间</th>
                    <th></th>
                </tr>               
            </thead>
            <tbody id="Searchresult"></tbody>
            <tbody id="hiddenresult" style="display:none">
                <% for (int i = 0; i < resultList.Count; i++) { %>
                <tr class="result">
                    <td><a  href="#" onclick="SearchLog('SearchMain1.aspx','<%= resultList[i].PJId %>')"><% =resultList[i].PJId %></a></td>
                    <td><% =resultList[i].DisplayName %></td>
                    <td id="t1end<%=i %>">
                        <label id="l1end<%=i %>" class="date"><%=resultList[i].T1EndDate.ToShortDateString()%></label>
                    </td>
                    <td id="t2end<%=i %>">
                        <label id="l2end<%=i %>" class="date"><%=resultList[i].T2EndDate.ToShortDateString()%></label>
                    </td>
                    <td id="t3end<%=i %>">
                        <label id="l3end<%=i %>" class="date"><%=resultList[i].T3EndDate.ToShortDateString()%></label>
                    </td>
                    <td id="t4end<%=i %>">
                        <label id="l4end<%=i %>" class="date"><%=resultList[i].T4EndDate.ToShortDateString()%></label>
                    </td>
                    <td id="t5end<%=i %>">
                        <label id="l5end<%=i %>" class="date"><%=resultList[i].T5EndDate.ToShortDateString()%></label>
                    </td>
                    <td id="t1realend<%=i %>">
                        <label id="l1realend<%=i %>" class="date"><%=resultList[i].T1RealEndDate.ToShortDateString()%></label>
                    </td>
                    <td id="t2realend<%=i %>">
                        <label id="l2realend<%=i %>" class="date"><%=resultList[i].T2RealEndDate.ToShortDateString()%></label>
                    </td>
                    <td id="t3realend<%=i %>">
                        <label id="l3realend<%=i %>" class="date"><%=resultList[i].T3RealEndDate.ToShortDateString()%></label>
                    </td>
                    <td id="t4realend<%=i %>">
                        <label id="l4realend<%=i %>" class="date"><%=resultList[i].T4RealEndDate.ToShortDateString()%></label>
                    </td>
                    <td id="t5realend<%=i %>">
                        <label id="l5realend<%=i %>" class="date"><%=resultList[i].T5RealEndDate.ToShortDateString()%></label>
                    </td>



                    <td><a  href="#" onclick="SearchLog('SearchLog.aspx','<%= resultList[i].PJId %>')">日志</a></td>

                </tr>
                <% }%>
            </tbody>
         </table>
         <div id="Pagination" class="pagination definewidth m10"></div>
    </div>
    </form>
    <script type="text/javascript">
        $(document).ready(function () {
            var count = "<% =resultList.Count%>";
            if (count >= 10) {
                $("#Pagination").show();
            } else {
                $("#Pagination").hide();
            }
            $(".date").each(function () {
                if ($(this).text() == "1900/01/01" || $(this).text() == "1900/1/1") {
                    $(this).text("");
                }
            });
            for (var i = 0; i < count; i++) {
                ShowColor("#l1end", "#l1realend", "#t1realend", i);
                ShowColor("#l2end", "#l2realend", "#t2realend", i);
                ShowColor("#l3end", "#l3realend", "#t3realend", i);
                ShowColor("#l4end", "#l4realend", "#t4realend", i);
                ShowColor("#l5end", "#l5realend", "#t5realend", i);
            }


        });
        function ShowColor(str1,str2,str3,i) {
            var date1 = new Date($(str1 + i).text());
            var date2 = new Date($(str2 + i).text());
            if (date1 >= date2) {
                $(str3 + i).attr("class", "greenColor");
            }
            else if (date1 < date2) {
                $(str3 + i).attr("class", "redColor");
            }
            else {

            }
        }
        function Validate() {
            if ($("#txtNo1").val().length = 0) {
                alert('请输入起始项目编号');
                return false;
            }
        }

    </script>
</body>
</html>
